//
//  Person.h
//  OC06_集合遍历_数组排序
//
//  Created by Scott on 16/3/3.
//  Copyright © 2016年 Scott. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Person : NSObject

@property (nonatomic, retain) NSString *name;
@property (nonatomic, assign) NSInteger age;

- initWithName:(NSString *)name age:(NSInteger)age;

+ (instancetype)personWithName:(NSString *)name age:(NSInteger)age;

/** 根据姓名降序排序. */
- (NSComparisonResult)DeSortedByName:(Person *)person;

/** 根据姓名升序排序. */
- (NSComparisonResult)asSortedByName:(Person *)person;

/** 根据年龄升序排序. */
- (NSComparisonResult)asSortedByAge:(Person *)person;


/** 根据年龄降序排序. */
- (NSComparisonResult)DesortedbyAge:(Person *)person;



@end
